package controller;

import dto.ActionDTO;
import dto.ActionTypeEnum;

public class CommandHandlerFactory {
    public CommandHandler createCommandHandler(ActionDTO dto) {
        if (dto.getType() == ActionTypeEnum.GET) {
            return new GetCommandHandler();
        } else if (dto.getType() == ActionTypeEnum.SET) {
            return new SetCommandHandler();
        } else if (dto.getType() == ActionTypeEnum.RM) {
            return new RmCommandHandler();
        }
        // 可根据需求添加其他命令处理类
        return null;
    }
}